﻿<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>获取JavaScript函数中的所有参数</title>
    <script type="text/javascript" language="JavaScript">
        let arr = [1,2,3];
        let val = 10;
        function myFun(arg1,arg2,arg3){
            let args = myFun.arguments;
            for(let i = 0;i< args.length;i++){
                alert(args[i]);
            }
        }
        myFun('myfile1',arr,val);
    </script>
</head>
<body>

</body>
</html>